package com.ruijixiang.leetcode.everyday.leetcode2024.leetcode202409;

public class leetcode20240923 {
    public int maxScoreSightseeingPair(int[] values){
        int ans=0,mx=values[0]+0;
        for(int j=1;j<values.length;j++){
            ans=Math.max(ans,mx+values[j]-j);
            mx=Math.max(mx,values[j]+j);
        }
        return ans;
    }
}
